<?php namespace Common\Model;
use Hdphp\Model\Model;
//用户管理模型
class User extends Model{
	//指定表名
    protected $table = "user";
    protected $validate = array(
         array('useremail','required','email地址不能为空',3,3),
         array('useremail','unique','email已注册',3,3),
         array('userpassword','required','密码不能为空',3,3),
    );
     //模型里的store方法
    public function store(){
    	$_POST['userpassword']=Q('post.userpassword','','md5');
    	// p($_POST); die;
    	if($this->create()){
    		return $this->add();
    	}else{
    		return false;
    	} 
    }
}